<template>
  <div>
    <el-menu class="menu-Bar">
      <TreeMenu :treeMenu="menuData" :treePath="main"></TreeMenu>
    </el-menu>
  </div>
</template>

<script>
import TreeMenu from "@/views/main/treeMenu/treeMenu.vue";

export default {
  name: "treeMenu_index",
  data() {
    return {
      menuData: [],
      main: "/首页"
    };
  },
  created() {
    if(this.$store.state.menuShow === 1 ){
      this.main = "/首页";
    }else if(this.$store.state.menuShow === 2 ){
      this.main = "";
    }
    console.log(this.$store.state.router[0].children);
    this.menuData = this.$store.state.router[0].children;
  },
  components: {
    TreeMenu
  }
};
</script>

<style scoped></style>
